
<?php include("header.php"); ?>

<script type="text/javascript">

function addQuestion() {
    window.location.href = "<?php echo SITE_URL;?>/?c=CulturalMosaic&a=addQuestion";
}

</script>
	<div class="one_third">
		<div class="box_tool">
			<div class="box_head"><?php echo _LB_TOOLBOX; ?></div>

			<div class="box_content">
                            <a href="<?php echo SITE_URL."?c=CulturalMosaic&a=addQuestion"; ?>" onclick="addQuestion();">
                                <?php echo _LB_ADD_QUESTION_ANSWER; ?>
                            </a>
			</div>
		</div>
		<div class="spacer"></div>
	</div>

	<div class="two_third" style="height:1%">
		<div class="box_two_third">
			<div class="box_head"><?php echo _LB_QUESTION_LIST; ?></div>
			<div class="box_content">
			<?php if($question->countRows()) { ?>
                            <?php $cur_question = 0; ?>
					<?php while($question->fetchNext()) { ?>
						<div class="object">
							<div class="head">
								<div class="right remove_top">
									<a href="<?php echo SITE_URL;?>/?c=CulturalMosaic&a=editQuestion&id=<?php echo $question->question_id;?>">
										<img src="<?php echo SITE_URL;?>/images/<?php echo IMAGE_NAME_EDIT_SMALL;?>" title="<?php echo _LB_EDIT;?>" alt="<?php echo _LB_EDIT;?>"/>
									</a>
									<?php if($question->isDeleteAble($question->question_id)) { ?>
										<a onclick="return confirm('<?php echo _MSG_DELETE_CONFIRM;?>');" href="<?php echo SITE_URL;?>/?c=CulturalMosaic&a=deleteQuestion&id=<?php echo $question->question_id;?>">
											<img src="<?php echo SITE_URL;?>/images/<?php echo IMAGE_NAME_DELETE_SMALL?>" title="<?php echo _LB_DELETE;?>" alt="<?php echo _LB_DELETE;?>"/>
										</a>
									<?php } else { ?>
										<img class="small" src="<?php echo SITE_URL;?>/images/delete_not_small.png"/>
									<?php } ?>
								</div>
								<b><?php echo $question->question_title;?></b>
							</div>
							<div class="content">
								<table border="0" cellpadding="3" cellspacing="0">
									<tr>
										<td width="90%">
											<?php echo $question->answer_content; ?>
										</td>
									</tr>
								</table>
							</div>
						</div>	
					<?php } ?>
                                                        
			<?php } else { ?>
				<p><?php echo _MSG_NO_EXISTING_QUESTION;?></p>
			<?php } ?>
			</div>
		</div>
		
	</div>
<?php include("footer.php"); ?>
